//
//  IntegralTableViewCell.m
//  AnXin100
//
//  Created by Sakura on 2018/10/31.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "IntegralTableViewCell.h"
#import "IntegralChildTableViewCell.h"
@interface IntegralTableViewCell ()<UITableViewDelegate, UITableViewDataSource>

@property (nonatomic, strong) UITableView *cellTable;

@property (nonatomic, strong) UIView *backView;

@end

@implementation IntegralTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatCell];
    }
    return self;
}

- (void)creatCell {
    
    _backView = [UIView new];
    _backView.layer.cornerRadius = 10;
    _backView.layer.borderWidth = 1;
    _backView.layer.borderColor = [UIColor colorWithHex:0xE6E6E6].CGColor;
    [self.contentView addSubview:_backView];
    
    _cellTable = [[UITableView alloc] init];
    _cellTable.delegate = self;
    _cellTable.dataSource = self;
    _cellTable.separatorStyle = UITableViewCellSeparatorStyleNone;
    [_cellTable registerClass:[IntegralChildTableViewCell class] forCellReuseIdentifier:@"IntegralChildTableViewCell"];
    [_backView addSubview:_cellTable];
}

- (void)layoutSubviews {
    
    _backView.frame = CGRectMake(10, 10, self.mj_w - 20, self.mj_h - 20);
    _cellTable.frame = CGRectMake(0, 0, _backView.mj_w, _backView.mj_h);
    
}



- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 40;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    IntegralChildTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IntegralChildTableViewCell"];
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
